<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String userName = user.getName();
	String nowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
%>

<div>
		<form id="newsFORM" name="form" target="coreIframe"
			action="<%=request.getContextPath()%>/site/doNewsAdd" method="post" enctype="multipart/form-data">
			<div class="breadcrumb">
				<div class="bcIcon"></div>
				<ul class="bcNav">
					<li>发布新闻</li>
				</ul>
			</div>

			<table class="formTable">
				<tr>
					<td class="tdTitle">新闻类型:</td>
					<td><select name="type">
							<option value="0">公司新闻</option>
							<option value="1">行业新闻</option>
					</select></td>
				</tr>
				
				<tr>
					<td class="tdTitle">来源:</td>
					<td><input class="inputText xxs"  name="newsSource"></td>
				</tr>

				<tr>
					<td class="tdTitle">发布时间:</td>
					<td><input class="inputText xs" type="text" name="publicTime"
						 value="<%=nowDate%>"
						onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" /></td>
				</tr>
				<tr>
					<td class="tdTitle">发布人:</td>
					<td><input class="inputText xs" type="text" name="publicMan"
						 placeholder="请输入发布人" value="<%=userName%>" /></td>
				</tr>
				<tr>
					<td class="tdTitle">标题:</td>
					<td><input class="inputText s" type="text" name="title" 
						 placeholder="请输入标题" /><span class="errorTipWrap" id="errorTip_title"></span></td>
				</tr>
				<tr>
					<td class="tdTitle">摘要:</td>
					<td><input class="inputText s" type="text" name="newsAbstract"
						 placeholder="请输入摘要" /></td>
				</tr>				
				<tr>
					<td class="tdTitle">可选属性:</td>
					<td class="" colspan="2">
						<div class="checkbox-wrap">
							<label>
								<input id="setTop" type="checkbox" value="1" name="istop" class="checkbox">
								<span>置顶</span>
							</label>
							<label>
								<input id="setImportant" type="checkbox" value="1" name="isimportant" class="checkbox">
								<span>重要</span>
							</label>
						</div>
					</td>
				</tr>
				<tr>
					<td class="tdTitle">图片:</td>
					<td><input type="file" name="imgFile" id="up">
						<span style="color:#ff5a00">尺寸要求：宽280px 高200px</span>
						<div><img id="imgPreview" width="70" height="50" /></div>
					</td>
				</tr>	

				<tr>
					<td class="tdTitle">详细内容：</td>
					<td class="" colspan="2">
						<div style="padding-top: 10px; padding-bottom: 10px;">
							<textarea id="content" name="content"
								style="width: 700px; height: 200px; visibility: hidden;"></textarea>
						</div>
						<span class="errorTipWrap" id="errorTip_content"></span>
					</td>
				</tr>
				<tr>
					<td class="tdTitle">发布:</td>
					<td>
						<label> 
							<input id="isShow" type="radio" name="isShow" value="0" checked="checked" /><span>暂不发布</span>
						</label> 
						<label> 
							<input id="isShow" type="radio" name="isShow" value="1"/><span>立即发布</span>
						</label> 
					</td>
				</tr>
				<tr>
					<td class="tdTitle"></td>
					<td>
						<div>
							<input class="input-btn-microsoft" type="submit" value="提交" id="click_btn">
							<a class="a-btn-microsoft"
								href="javascript:XF.Site.requestUrl('/site/news')">取消</a>
						</div>
					</td>
				</tr>
			</table>
		</form>
</div>
<iframe name="coreIframe" style="display: none"></iframe>
<script type="text/javascript">
	$(function() {
		XF.createKindEditor("content");
		$("input[name=newsSource]").focus();
		$("#up").uploadPreview({ Img: "imgPreview", Width: 152, Height: 100 });

	}); 
</script>
</html>